/<template>
<div class="Index">
    <van-tabs v-model="active">
        <van-tab :title="item.txt" v-for="(item,index) in AllList" :key="index">
            <ChildrenList :ChildrenList= 'AllList[active].children'></ChildrenList>
        </van-tab>
    </van-tabs>
</div>
</template>

<script>
import '../../Utils/dataList';
import axios from '../../Utils/request';
import ChildrenList from '@/components/ChildrenList.vue'
import jwt from 'jsonwebtoken';

export default {
    data(){
        return {
            AllList :[] ,
            active: 0,
        }
    },
    created() {
        this.getData();
        var token ='Bearer ' + jwt.sign({ foo: 'bar' }, 'shhhhh');
        console.log(token,'---token');
    },
    methods: {
        
        getData() {
            axios.get('/api/list').then(res=>{
                this.AllList = res.data.list
            })
            console.log(this.AllList);
        },
    },
    mounted() {
    },
    components: {
        ChildrenList
    },
    
}
</script>

<style scoped lang="scss">
.Index{
    width: 100%;
    height: 100%;
}
</style>